﻿using System.Collections.Generic;
using System.Xml.Serialization;
using Inkubator.Wizard.Model.Interaction;

namespace Inkubator.Wizard.Model.Model
{
    /// <summary>
    /// Step class represent each individual step that the Wizard will contain.
    /// </summary>
    [XmlRoot("step")]
    public class Step
    {
        /// <summary>
        /// The name that the Wizard will show when this Step is loaded
        /// </summary>
        public string name;
        /// <summary>
        /// The description that the Wizard will place on the beginning of each Step
        /// </summary>
        public string description;
        /// <summary>
        /// A list of the Layouts that this Step contain.
        /// A Step can contain as many layouts as it is necessary to help who write the
        /// XML File to define how will be the order of the components.
        /// </summary>
        public List<Layout> layouts;
        /// <summary>
        /// DoActions construction let you define a DLL/EXE to be executed based on the
        /// results of this step.
        /// </summary>
        public DoAction doActions;
        /// <summary>
        /// Not implemented
        /// </summary>
        public Code codes;

        [XmlAttribute("id")]
        public string ID;

        public Step() 
        {
            layouts = new List<Layout>();
        }

        public Step(string name, string description, List<Layout> layouts)
        {
            this.layouts = layouts;
            this.name = name;
            this.description = description;
        }

        /// <summary>
        /// Add a new Layout to the Layouts List
        /// </summary>
        /// <param name="layout"></param>
        public void AddLayout(Layout layout)
        {
            layouts.Add(layout);
        }

    }
}
